Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Ref operations #36

Merged
merged 1 commit into from
Aug 6, 2023
Merged

Refactor Ref operations #36

merged 1 commit into from
Aug 6, 2023

Conversation

JD557
Copy link
Owner

@JD557 JD557 commented Aug 6, 2023

Removes the Ref.get/Ref.set/Ref.modify operations in favor of Ref#get/Ref#:=/Ref#modify.

There's really not much of a reason to accept both Refs and raw values, and those operations were quite verbose and annoying to use.

This PR also makes Ref.value private. The rationale being:

  • It's a bit awkward to have multiple ways to get/set a value
  • In practice, I notice that in a lot of situations it's helpful to have a value: Ref[T] variable, and value.value just looks off
  • I've been thinking about the possibility or a Ref that does not actually hold a value, but it's more like a lens. Not sure if I'll ever go ahead with that idea, though.

@JD557 JD557 added this to the 0.1.4 milestone Aug 6, 2023
@JD557 JD557 merged commit eb0a103 into master Aug 6, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant